package main

import (
	"fmt"
	"os"
	"syscall"
)

func main() {
	fd, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_STREAM, syscall.IPPROTO_TCP)
	if err != nil {
		fmt.Fprintf(os.Stderr, "ERROR: %v\n", err)
		return
	}
	defer syscall.Close(fd)
	fmt.Println("socket的文件描述符:", fd)
	// 之后就省略了，要使用syscall包来建立网络连接，过程太繁琐
}
